import Vue from 'vue'
import VueRouter from 'vue-router'
// import Login from '../components/Login.vue';
// import Home from '@/components/Home';
// import Welcome from '@/components/Welcome';

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( /* webpackChunkName: "login" */ '../components/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/welcome',
    component: () => import( /*webpackChunkName: "Home"*/ '../components/Home.vue'),
    children: [
      {
        path: '/welcome',
        name: 'Welcome',
        component: () => import( /*webpackChunkName: "Home"*/ '../components/Welcome.vue'),
      },
      {
        path: '/users',
        name: 'Users',
        component: () => import( /*webpackChunkName: "User"*/ '../components/user/Users.vue')
      }
    ],
  },

]

const router = new VueRouter({
  routes
})

export default router
